import {
	defineConfig
} from "vite"
import uni from "@dcloudio/vite-plugin-uni";

export default defineConfig({
	plugins: [
		uni()
	],
	server: {
		port: 5174,
		proxy: {
			"/zwktest": {
				"target": "http://192.168.60.113",
				"changeOrigin": true,
				rewrite: path => {
					return path.replace(/^\/zwktest/, '/api')
				}
			},
			"/ywhtest": {
				"target": "http://192.168.51.116:8005",
				"changeOrigin": true,
				rewrite: path => {
					return path.replace(/^\/ywhtest/, '/api')
				}
			},
			"/cbtest": {
				"target": "http://192.168.60.121:8001",
				"changeOrigin": true,
				rewrite: path => {
					return path.replace(/^\/cbtest/, '/api')
				}
			},
			'/z3ysk2': {
				target: 'https://z3ysk.newcapec.cn',
				changeOrigin: true,
				rewrite: path => {
					return path.replace(/^\/z3ysk2/, '/api')
				}
			},
			'/z3ysk': {
				target: 'http://192.168.124.87:8083',
				changeOrigin: true,
				rewrite: path => {
					return path.replace(/^\/z3ysk/, '/api')
				}
			}
		}
	}
})